Optimal. Leaf size=92 \[ -\frac {\cot ^2(c+d x) \left (a^2+2 a b \sec (c+d x)+b^2\right )}{2 d}-\frac {a^2 \log (\cos (c+d x))}{d}-\frac {a (a+b) \log (1-\sec (c+d x))}{2 d}-\frac {a (a-b) \log (\sec (c+d x)+1)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3885, 1805, 801} \[ -\frac {\cot ^2(c+d x) \left (a^2+2 a b \sec (c+d x)+b^2\right )}{2 d}-\frac {a^2 \log (\cos (c+d x))}{d}-\frac {a (a+b) \log (1-\sec (c+d x))}{2 d}-\frac {a (a-b) \log (\sec (c+d x)+1)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 801
Rule 1805
Rule 3885
Rubi steps
\begin {align*} \int \cot ^3(c+d x) (a+b \sec (c+d x))^2 \, dx &=\frac {b^4 \operatorname {Subst}\left (\int \frac {(a+x)^2}{x \left (b^2-x^2\right )^2} \, dx,x,b \sec (c+d x)\right )}{d}\\ &=-\frac {\cot ^2(c+d x) \left (a^2+b^2+2 a b \sec (c+d x)\right )}{2 d}-\frac {b^2 \operatorname {Subst}\left (\int \frac {-2 a^2-2 a x}{x \left (b^2-x^2\right )} \, dx,x,b \sec (c+d x)\right )}{2 d}\\ &=-\frac {\cot ^2(c+d x) \left (a^2+b^2+2 a b \sec (c+d x)\right )}{2 d}-\frac {b^2 \operatorname {Subst}\left (\int \left (-\frac {a (a+b)}{b^2 (b-x)}-\frac {2 a^2}{b^2 x}+\frac {a (a-b)}{b^2 (b+x)}\right ) \, dx,x,b \sec (c+d x)\right )}{2 d}\\ &=-\frac {a^2 \log (\cos (c+d x))}{d}-\frac {a (a+b) \log (1-\sec (c+d x))}{2 d}-\frac {a (a-b) \log (1+\sec (c+d x))}{2 d}-\frac {\cot ^2(c+d x) \left (a^2+b^2+2 a b \sec (c+d x)\right )}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.47, size = 82, normalized size = 0.89 \[ -\frac {(a+b)^2 \csc ^2\left (\frac {1}{2} (c+d x)\right )+(a-b)^2 \sec ^2\left (\frac {1}{2} (c+d x)\right )+8 a \left ((a+b) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+(a-b) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.51, size = 113, normalized size = 1.23 \[ \frac {2 \, a b \cos \left (d x + c\right ) + a^{2} + b^{2} - {\left ({\left (a^{2} - a b\right )} \cos \left (d x + c\right )^{2} - a^{2} + a b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left ({\left (a^{2} + a b\right )} \cos \left (d x + c\right )^{2} - a^{2} - a b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.57, size = 209, normalized size = 2.27 \[ \frac {8 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) + \frac {a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {2 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - 4 \, {\left (a^{2} + a b\right )} \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) + \frac {{\left (a^{2} + 2 \, a b + b^{2} + \frac {4 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {4 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}{\cos \left (d x + c\right ) - 1}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.69, size = 108, normalized size = 1.17 \[ -\frac {a^{2} \left (\cot ^{2}\left (d x +c \right )\right )}{2 d}-\frac {a^{2} \ln \left (\sin \left (d x +c \right )\right )}{d}-\frac {a b \left (\cos ^{3}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )^{2}}-\frac {a b \cos \left (d x +c \right )}{d}-\frac {a b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}-\frac {b^{2}}{2 d \sin \left (d x +c \right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.50, size = 72, normalized size = 0.78 \[ -\frac {{\left (a^{2} - a b\right )} \log \left (\cos \left (d x + c\right ) + 1\right ) + {\left (a^{2} + a b\right )} \log \left (\cos \left (d x + c\right ) - 1\right ) - \frac {2 \, a b \cos \left (d x + c\right ) + a^{2} + b^{2}}{\cos \left (d x + c\right )^{2} - 1}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.36, size = 98, normalized size = 1.07 \[ \frac {a^2\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,{\left (a-b\right )}^2}{8\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2+b\,a\right )}{d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {a^2}{8}+\frac {a\,b}{4}+\frac {b^2}{8}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cot ^{3}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________